/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('safe', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ChangeCancelRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
}

model ChangeCancelResponseBody = {
  code?: int32(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangeCancelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeCancelResponseBody(name='body'),
}

/**
 * @summary 变更取消
 *
 * @param request ChangeCancelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeCancelResponse
 */
async function changeCancelWithOptions(request: ChangeCancelRequest, runtime: Util.RuntimeOptions): ChangeCancelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authKey)) {
    query['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    query['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    query['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    query['SourceOrderId'] = request.sourceOrderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeCancel',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更取消
 *
 * @param request ChangeCancelRequest
 * @return ChangeCancelResponse
 */
async function changeCancel(request: ChangeCancelRequest): ChangeCancelResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeCancelWithOptions(request, runtime);
}

model ChangeCheckRequest {
  affectCustomer?: string(name='AffectCustomer'),
  approveFlowParam?: {
    approveNodes?: [ 
      {
        approverDTO?: [ 
          {
            approveDesc?: string(name='ApproveDesc'),
            approveTime?: string(name='ApproveTime'),
            approverId?: string(name='ApproverId'),
            approverName?: string(name='ApproverName'),
            opinion?: int32(name='Opinion'),
          }
        ](name='ApproverDTO'),
        nodeStatus?: int32(name='NodeStatus'),
        processName?: string(name='ProcessName'),
        processNodeOrder?: int32(name='ProcessNodeOrder'),
        strategy?: int32(name='Strategy'),
      }
    ](name='ApproveNodes'),
    authKey?: string(name='AuthKey'),
    authSign?: string(name='AuthSign'),
    bgVid?: string(name='BgVid'),
    flowStatus?: int32(name='FlowStatus'),
    timestamp?: long(name='Timestamp'),
  }(name='ApproveFlowParam'),
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  bgCustomTemplateExtraDTO?: {
    bgCustomTemplate?: string(name='BgCustomTemplate'),
    bgCustomTemplateId?: long(name='BgCustomTemplateId'),
    bgCustomTemplateInfo?: string(name='BgCustomTemplateInfo'),
    bgCustomTemplateTitle?: string(name='BgCustomTemplateTitle'),
    bgVid?: string(name='BgVid'),
    extraInfo?: string(name='ExtraInfo'),
  }(name='BgCustomTemplateExtraDTO'),
  bgVid?: string(name='BgVid'),
  blockInfos?: [ 
    {
      hitInfos?: [ 
        {
          hitInfo?: string(name='HitInfo'),
          hitObject?: string(name='HitObject'),
          scope?: string(name='Scope'),
        }
      ](name='HitInfos'),
      id?: long(name='Id'),
    }
  ](name='BlockInfos'),
  callBackInfo?: {
    api?: string(name='Api'),
    apiVersion?: string(name='ApiVersion'),
    endPoint?: string(name='EndPoint'),
    extraInfo?: string(name='ExtraInfo'),
    popProduct?: string(name='PopProduct'),
    regionId?: string(name='RegionId'),
    type?: string(name='Type'),
    url?: string(name='Url'),
  }(name='CallBackInfo'),
  changeDataType?: string(name='ChangeDataType'),
  changeDesc?: string(name='ChangeDesc'),
  changeEndTime?: long(name='ChangeEndTime'),
  changeEnv?: string(name='ChangeEnv'),
  changeItems?: string(name='ChangeItems'),
  changeObject?: string(name='ChangeObject'),
  changeOptSubType?: string(name='ChangeOptSubType'),
  changeOptType?: string(name='ChangeOptType'),
  changeReason?: string(name='ChangeReason'),
  changeRmarks?: string(name='ChangeRmarks'),
  changeSchemes?: string(name='ChangeSchemes'),
  changeStartTime?: long(name='ChangeStartTime'),
  changeSubTypeDesc?: string(name='ChangeSubTypeDesc'),
  changeSystem?: string(name='ChangeSystem'),
  changeTimes?: [ 
    {
      changeEndTime?: long(name='ChangeEndTime'),
      changeStartTime?: long(name='ChangeStartTime'),
    }
  ](name='ChangeTimes'),
  changeTitle?: string(name='ChangeTitle'),
  changeValidation?: string(name='ChangeValidation'),
  creatorEmpId?: string(name='CreatorEmpId'),
  damagedChangeNotices?: [ 
    {
      bgCancelNoticeContent?: string(name='BgCancelNoticeContent'),
      bgCancelNoticeEventId?: string(name='BgCancelNoticeEventId'),
      channel?: [ string ](name='Channel'),
      content?: string(name='Content'),
      eventId?: string(name='EventId'),
      sensitiveCustomers?: [ 
        {
          customerInfo?: [ 
            {
              extraInfo?: map[string]any(name='ExtraInfo'),
              type?: string(name='Type'),
              uid?: string(name='Uid'),
            }
          ](name='CustomerInfo'),
          productCode?: string(name='ProductCode'),
        }
      ](name='SensitiveCustomers'),
      type?: string(name='Type'),
    }
  ](name='DamagedChangeNotices'),
  executorEmpId?: string(name='ExecutorEmpId'),
  extraInfo?: string(name='ExtraInfo'),
  follower?: [ string ](name='Follower'),
  grayStatus?: string(name='GrayStatus'),
  harmChangeNoticeEnum?: string(name='HarmChangeNoticeEnum'),
  incidence?: string(name='Incidence'),
  influenceInfo?: {
    noticeInfos?: [ 
      {
        channel?: [ string ](name='Channel'),
        content?: string(name='Content'),
        eventId?: string(name='EventId'),
      }
    ](name='NoticeInfos'),
    sensitiveCustomers?: [ 
      {
        customerInfo?: [ 
          {
            extraInfo?: map[string]any(name='ExtraInfo'),
            type?: string(name='Type'),
            uid?: string(name='Uid'),
          }
        ](name='CustomerInfo'),
        productCode?: string(name='ProductCode'),
      }
    ](name='SensitiveCustomers'),
  }(name='InfluenceInfo'),
  instance?: {
    attributionApp?: [ string ](name='AttributionApp'),
    influenceApp?: [ string ](name='InfluenceApp'),
    instance?: [ string ](name='Instance'),
    nc?: [ string ](name='Nc'),
    uids?: [ string ](name='Uids'),
  }(name='Instance'),
  needModifyDoc?: string(name='NeedModifyDoc'),
  product?: [ 
    {
      code?: string(name='Code'),
      name?: string(name='Name'),
    }
  ](name='Product'),
  releasePackageInfos?: [ 
    {
      productCode?: string(name='ProductCode'),
      releasePackage?: [ string ](name='ReleasePackage'),
    }
  ](name='ReleasePackageInfos'),
  reqTimestamp?: long(name='ReqTimestamp'),
  reuseSourceOrderId?: string(name='ReuseSourceOrderId'),
  riskLevel?: string(name='RiskLevel'),
  rollback?: string(name='Rollback'),
  sourceName?: string(name='SourceName'),
  sourceOrderId?: string(name='SourceOrderId'),
  sourceUrl?: string(name='SourceUrl'),
  whiteType?: int32(name='WhiteType'),
}

model ChangeCheckShrinkRequest {
  affectCustomer?: string(name='AffectCustomer'),
  approveFlowParam?: {
    approveNodes?: [ 
      {
        approverDTO?: [ 
          {
            approveDesc?: string(name='ApproveDesc'),
            approveTime?: string(name='ApproveTime'),
            approverId?: string(name='ApproverId'),
            approverName?: string(name='ApproverName'),
            opinion?: int32(name='Opinion'),
          }
        ](name='ApproverDTO'),
        nodeStatus?: int32(name='NodeStatus'),
        processName?: string(name='ProcessName'),
        processNodeOrder?: int32(name='ProcessNodeOrder'),
        strategy?: int32(name='Strategy'),
      }
    ](name='ApproveNodes'),
    authKey?: string(name='AuthKey'),
    authSign?: string(name='AuthSign'),
    bgVid?: string(name='BgVid'),
    flowStatus?: int32(name='FlowStatus'),
    timestamp?: long(name='Timestamp'),
  }(name='ApproveFlowParam'),
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  bgCustomTemplateExtraDTO?: {
    bgCustomTemplate?: string(name='BgCustomTemplate'),
    bgCustomTemplateId?: long(name='BgCustomTemplateId'),
    bgCustomTemplateInfo?: string(name='BgCustomTemplateInfo'),
    bgCustomTemplateTitle?: string(name='BgCustomTemplateTitle'),
    bgVid?: string(name='BgVid'),
    extraInfo?: string(name='ExtraInfo'),
  }(name='BgCustomTemplateExtraDTO'),
  bgVid?: string(name='BgVid'),
  blockInfos?: [ 
    {
      hitInfos?: [ 
        {
          hitInfo?: string(name='HitInfo'),
          hitObject?: string(name='HitObject'),
          scope?: string(name='Scope'),
        }
      ](name='HitInfos'),
      id?: long(name='Id'),
    }
  ](name='BlockInfos'),
  callBackInfo?: {
    api?: string(name='Api'),
    apiVersion?: string(name='ApiVersion'),
    endPoint?: string(name='EndPoint'),
    extraInfo?: string(name='ExtraInfo'),
    popProduct?: string(name='PopProduct'),
    regionId?: string(name='RegionId'),
    type?: string(name='Type'),
    url?: string(name='Url'),
  }(name='CallBackInfo'),
  changeDataType?: string(name='ChangeDataType'),
  changeDesc?: string(name='ChangeDesc'),
  changeEndTime?: long(name='ChangeEndTime'),
  changeEnv?: string(name='ChangeEnv'),
  changeItems?: string(name='ChangeItems'),
  changeObject?: string(name='ChangeObject'),
  changeOptSubType?: string(name='ChangeOptSubType'),
  changeOptType?: string(name='ChangeOptType'),
  changeReason?: string(name='ChangeReason'),
  changeRmarks?: string(name='ChangeRmarks'),
  changeSchemes?: string(name='ChangeSchemes'),
  changeStartTime?: long(name='ChangeStartTime'),
  changeSubTypeDesc?: string(name='ChangeSubTypeDesc'),
  changeSystem?: string(name='ChangeSystem'),
  changeTimes?: [ 
    {
      changeEndTime?: long(name='ChangeEndTime'),
      changeStartTime?: long(name='ChangeStartTime'),
    }
  ](name='ChangeTimes'),
  changeTitle?: string(name='ChangeTitle'),
  changeValidation?: string(name='ChangeValidation'),
  creatorEmpId?: string(name='CreatorEmpId'),
  damagedChangeNoticesShrink?: string(name='DamagedChangeNotices'),
  executorEmpId?: string(name='ExecutorEmpId'),
  extraInfo?: string(name='ExtraInfo'),
  follower?: [ string ](name='Follower'),
  grayStatus?: string(name='GrayStatus'),
  harmChangeNoticeEnum?: string(name='HarmChangeNoticeEnum'),
  incidence?: string(name='Incidence'),
  influenceInfo?: {
    noticeInfos?: [ 
      {
        channel?: [ string ](name='Channel'),
        content?: string(name='Content'),
        eventId?: string(name='EventId'),
      }
    ](name='NoticeInfos'),
    sensitiveCustomers?: [ 
      {
        customerInfo?: [ 
          {
            extraInfo?: map[string]any(name='ExtraInfo'),
            type?: string(name='Type'),
            uid?: string(name='Uid'),
          }
        ](name='CustomerInfo'),
        productCode?: string(name='ProductCode'),
      }
    ](name='SensitiveCustomers'),
  }(name='InfluenceInfo'),
  instance?: {
    attributionApp?: [ string ](name='AttributionApp'),
    influenceApp?: [ string ](name='InfluenceApp'),
    instance?: [ string ](name='Instance'),
    nc?: [ string ](name='Nc'),
    uids?: [ string ](name='Uids'),
  }(name='Instance'),
  needModifyDoc?: string(name='NeedModifyDoc'),
  product?: [ 
    {
      code?: string(name='Code'),
      name?: string(name='Name'),
    }
  ](name='Product'),
  releasePackageInfos?: [ 
    {
      productCode?: string(name='ProductCode'),
      releasePackage?: [ string ](name='ReleasePackage'),
    }
  ](name='ReleasePackageInfos'),
  reqTimestamp?: long(name='ReqTimestamp'),
  reuseSourceOrderId?: string(name='ReuseSourceOrderId'),
  riskLevel?: string(name='RiskLevel'),
  rollback?: string(name='Rollback'),
  sourceName?: string(name='SourceName'),
  sourceOrderId?: string(name='SourceOrderId'),
  sourceUrl?: string(name='SourceUrl'),
  whiteType?: int32(name='WhiteType'),
}

model ChangeCheckResponseBody = {
  code?: int32(name='Code'),
  data?: {
    approveResultUrl?: string(name='ApproveResultUrl'),
    bgCheckStatus?: string(name='BgCheckStatus'),
    bgVid?: string(name='BgVid'),
    changeStatus?: string(name='ChangeStatus'),
    checkResultUrl?: string(name='CheckResultUrl'),
    checkStatus?: string(name='CheckStatus'),
    checkholdReason?: [ string ](name='CheckholdReason'),
    ruleDetailUrlList?: [ 
      {
        sceneEnum?: string(name='SceneEnum'),
        title?: string(name='Title'),
        url?: string(name='Url'),
      }
    ](name='RuleDetailUrlList'),
    sourceOrderId?: string(name='SourceOrderId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangeCheckResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeCheckResponseBody(name='body'),
}

/**
 * @summary 安全变更check
 *
 * @param tmpReq ChangeCheckRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeCheckResponse
 */
async function changeCheckWithOptions(tmpReq: ChangeCheckRequest, runtime: Util.RuntimeOptions): ChangeCheckResponse {
  Util.validateModel(tmpReq);
  var request = new ChangeCheckShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.damagedChangeNotices)) {
    request.damagedChangeNoticesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.damagedChangeNotices, 'DamagedChangeNotices', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.affectCustomer)) {
    body['AffectCustomer'] = request.affectCustomer;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.approveFlowParam)) {
    bodyFlat['ApproveFlowParam'] = request.approveFlowParam;
  }
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.bgCustomTemplateExtraDTO)) {
    bodyFlat['BgCustomTemplateExtraDTO'] = request.bgCustomTemplateExtraDTO;
  }
  if (!Util.isUnset(request.bgVid)) {
    body['BgVid'] = request.bgVid;
  }
  if (!Util.isUnset(request.blockInfos)) {
    body['BlockInfos'] = request.blockInfos;
  }
  if (!Util.isUnset(request.callBackInfo)) {
    bodyFlat['CallBackInfo'] = request.callBackInfo;
  }
  if (!Util.isUnset(request.changeDataType)) {
    body['ChangeDataType'] = request.changeDataType;
  }
  if (!Util.isUnset(request.changeDesc)) {
    body['ChangeDesc'] = request.changeDesc;
  }
  if (!Util.isUnset(request.changeEndTime)) {
    body['ChangeEndTime'] = request.changeEndTime;
  }
  if (!Util.isUnset(request.changeEnv)) {
    body['ChangeEnv'] = request.changeEnv;
  }
  if (!Util.isUnset(request.changeItems)) {
    body['ChangeItems'] = request.changeItems;
  }
  if (!Util.isUnset(request.changeObject)) {
    body['ChangeObject'] = request.changeObject;
  }
  if (!Util.isUnset(request.changeOptSubType)) {
    body['ChangeOptSubType'] = request.changeOptSubType;
  }
  if (!Util.isUnset(request.changeOptType)) {
    body['ChangeOptType'] = request.changeOptType;
  }
  if (!Util.isUnset(request.changeReason)) {
    body['ChangeReason'] = request.changeReason;
  }
  if (!Util.isUnset(request.changeRmarks)) {
    body['ChangeRmarks'] = request.changeRmarks;
  }
  if (!Util.isUnset(request.changeSchemes)) {
    body['ChangeSchemes'] = request.changeSchemes;
  }
  if (!Util.isUnset(request.changeStartTime)) {
    body['ChangeStartTime'] = request.changeStartTime;
  }
  if (!Util.isUnset(request.changeSubTypeDesc)) {
    body['ChangeSubTypeDesc'] = request.changeSubTypeDesc;
  }
  if (!Util.isUnset(request.changeSystem)) {
    body['ChangeSystem'] = request.changeSystem;
  }
  if (!Util.isUnset(request.changeTimes)) {
    body['ChangeTimes'] = request.changeTimes;
  }
  if (!Util.isUnset(request.changeTitle)) {
    body['ChangeTitle'] = request.changeTitle;
  }
  if (!Util.isUnset(request.changeValidation)) {
    body['ChangeValidation'] = request.changeValidation;
  }
  if (!Util.isUnset(request.creatorEmpId)) {
    body['CreatorEmpId'] = request.creatorEmpId;
  }
  if (!Util.isUnset(request.damagedChangeNoticesShrink)) {
    body['DamagedChangeNotices'] = request.damagedChangeNoticesShrink;
  }
  if (!Util.isUnset(request.executorEmpId)) {
    body['ExecutorEmpId'] = request.executorEmpId;
  }
  if (!Util.isUnset(request.extraInfo)) {
    body['ExtraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.follower)) {
    body['Follower'] = request.follower;
  }
  if (!Util.isUnset(request.grayStatus)) {
    body['GrayStatus'] = request.grayStatus;
  }
  if (!Util.isUnset(request.harmChangeNoticeEnum)) {
    body['HarmChangeNoticeEnum'] = request.harmChangeNoticeEnum;
  }
  if (!Util.isUnset(request.incidence)) {
    body['Incidence'] = request.incidence;
  }
  if (!Util.isUnset(request.influenceInfo)) {
    bodyFlat['InfluenceInfo'] = request.influenceInfo;
  }
  if (!Util.isUnset(request.instance)) {
    bodyFlat['Instance'] = request.instance;
  }
  if (!Util.isUnset(request.needModifyDoc)) {
    body['NeedModifyDoc'] = request.needModifyDoc;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  if (!Util.isUnset(request.releasePackageInfos)) {
    body['ReleasePackageInfos'] = request.releasePackageInfos;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.reuseSourceOrderId)) {
    body['ReuseSourceOrderId'] = request.reuseSourceOrderId;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.rollback)) {
    body['Rollback'] = request.rollback;
  }
  if (!Util.isUnset(request.sourceName)) {
    body['SourceName'] = request.sourceName;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.sourceUrl)) {
    body['SourceUrl'] = request.sourceUrl;
  }
  if (!Util.isUnset(request.whiteType)) {
    body['WhiteType'] = request.whiteType;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ChangeCheck',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 安全变更check
 *
 * @param request ChangeCheckRequest
 * @return ChangeCheckResponse
 */
async function changeCheck(request: ChangeCheckRequest): ChangeCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeCheckWithOptions(request, runtime);
}

model ChangeEndRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  changeEndTime?: long(name='ChangeEndTime'),
  changeResult?: string(name='ChangeResult'),
  curBatchNo?: int32(name='CurBatchNo'),
  executorEmpId?: string(name='ExecutorEmpId'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
  totalBatchNo?: int32(name='TotalBatchNo'),
}

model ChangeEndResponseBody = {
  code?: int32(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangeEndResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeEndResponseBody(name='body'),
}

/**
 * @summary 变更执行end
 *
 * @param request ChangeEndRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeEndResponse
 */
async function changeEndWithOptions(request: ChangeEndRequest, runtime: Util.RuntimeOptions): ChangeEndResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authKey)) {
    query['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    query['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.changeEndTime)) {
    query['ChangeEndTime'] = request.changeEndTime;
  }
  if (!Util.isUnset(request.changeResult)) {
    query['ChangeResult'] = request.changeResult;
  }
  if (!Util.isUnset(request.curBatchNo)) {
    query['CurBatchNo'] = request.curBatchNo;
  }
  if (!Util.isUnset(request.executorEmpId)) {
    query['ExecutorEmpId'] = request.executorEmpId;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    query['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    query['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.totalBatchNo)) {
    query['TotalBatchNo'] = request.totalBatchNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeEnd',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更执行end
 *
 * @param request ChangeEndRequest
 * @return ChangeEndResponse
 */
async function changeEnd(request: ChangeEndRequest): ChangeEndResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeEndWithOptions(request, runtime);
}

model ChangeStartRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  changeEndTime?: long(name='ChangeEndTime'),
  changeObject?: string(name='ChangeObject'),
  changeOptType?: string(name='ChangeOptType'),
  changeStartTime?: long(name='ChangeStartTime'),
  changeTitle?: string(name='ChangeTitle'),
  creatorEmpId?: string(name='CreatorEmpId'),
  curBatchNo?: int32(name='CurBatchNo'),
  executorEmpId?: string(name='ExecutorEmpId'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
  totalBatchNo?: int32(name='TotalBatchNo'),
}

model ChangeStartResponseBody = {
  code?: int32(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangeStartResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeStartResponseBody(name='body'),
}

/**
 * @summary 变更执行start
 *
 * @param request ChangeStartRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeStartResponse
 */
async function changeStartWithOptions(request: ChangeStartRequest, runtime: Util.RuntimeOptions): ChangeStartResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authKey)) {
    query['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    query['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.changeEndTime)) {
    query['ChangeEndTime'] = request.changeEndTime;
  }
  if (!Util.isUnset(request.changeObject)) {
    query['ChangeObject'] = request.changeObject;
  }
  if (!Util.isUnset(request.changeOptType)) {
    query['ChangeOptType'] = request.changeOptType;
  }
  if (!Util.isUnset(request.changeStartTime)) {
    query['ChangeStartTime'] = request.changeStartTime;
  }
  if (!Util.isUnset(request.changeTitle)) {
    query['ChangeTitle'] = request.changeTitle;
  }
  if (!Util.isUnset(request.creatorEmpId)) {
    query['CreatorEmpId'] = request.creatorEmpId;
  }
  if (!Util.isUnset(request.curBatchNo)) {
    query['CurBatchNo'] = request.curBatchNo;
  }
  if (!Util.isUnset(request.executorEmpId)) {
    query['ExecutorEmpId'] = request.executorEmpId;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    query['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    query['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.totalBatchNo)) {
    query['TotalBatchNo'] = request.totalBatchNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeStart',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更执行start
 *
 * @param request ChangeStartRequest
 * @return ChangeStartResponse
 */
async function changeStart(request: ChangeStartRequest): ChangeStartResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeStartWithOptions(request, runtime);
}

model CreateBlockRequest {
  approveStrategyNodes?: [ 
    {
      approveRuleType?: int32(name='ApproveRuleType'),
      approveType?: int32(name='ApproveType'),
      id?: long(name='Id'),
      name?: string(name='Name'),
      nodeCode?: string(name='NodeCode'),
      priorityOrder?: int32(name='PriorityOrder'),
      roleCode?: int32(name='RoleCode'),
      roleValue?: [ string ](name='RoleValue'),
      templateId?: long(name='TemplateId'),
    }
  ](name='ApproveStrategyNodes'),
  blockId?: long(name='BlockId'),
  director?: string(name='Director'),
  isNeedApprove?: int32(name='IsNeedApprove'),
  isRecall?: int32(name='IsRecall'),
  isTemplate?: int32(name='IsTemplate'),
  labelName?: string(name='LabelName'),
  noticeDesc?: string(name='NoticeDesc'),
  noticeEnclosureInfos?: [ 
    {
      name?: string(name='Name'),
      url?: string(name='url'),
    }
  ](name='NoticeEnclosureInfos'),
  noticeRequestLink?: string(name='NoticeRequestLink'),
  noticeType?: int32(name='NoticeType'),
  reason?: string(name='Reason'),
  scene?: int32(name='Scene'),
  scopes?: [ 
    {
      blockHarm?: [ int32 ](name='BlockHarm'),
      blockScope?: {
        app?: {
          appName?: [ string ](name='AppName'),
          type?: int32(name='Type'),
        }(name='App'),
        bgSystem?: [ 
          {
            relateCodes?: [ string ](name='RelateCodes'),
            selfCodeName?: string(name='SelfCodeName'),
          }
        ](name='BgSystem'),
        cluster?: {
          codeNames?: [ string ](name='CodeNames'),
          relations?: [ 
            {
              appCodes?: [ string ](name='AppCodes'),
              labelCodes?: [ string ](name='LabelCodes'),
              relateCodes?: [ string ](name='RelateCodes'),
              selfCode?: string(name='SelfCode'),
            }
          ](name='Relations'),
        }(name='Cluster'),
        customer?: [ 
          {
            codeNames?: [ string ](name='CodeNames'),
            relations?: [ 
              {
                appCodes?: [ string ](name='AppCodes'),
                labelCodes?: [ string ](name='LabelCodes'),
                relateCodes?: [ string ](name='RelateCodes'),
                selfCode?: string(name='SelfCode'),
              }
            ](name='Relations'),
            uid?: string(name='Uid'),
            viewCodes?: [ int32 ](name='ViewCodes'),
          }
        ](name='Customer'),
        dept?: [ string ](name='Dept'),
        express?: string(name='Express'),
        infrastructure?: [ string ](name='Infrastructure'),
        product?: [ 
          {
            codeNames?: [ string ](name='CodeNames'),
            key?: string(name='Key'),
            relations?: [ 
              {
                appCodes?: [ string ](name='AppCodes'),
                labelCodes?: [ string ](name='LabelCodes'),
                relateCodes?: [ string ](name='RelateCodes'),
                selfCode?: string(name='SelfCode'),
              }
            ](name='Relations'),
            viewCode?: [ string ](name='ViewCode'),
          }
        ](name='Product'),
      }(name='BlockScope'),
      effectTime?: [ long ](name='EffectTime'),
      scopeRule?: string(name='ScopeRule'),
    }
  ](name='Scopes'),
  status?: int32(name='Status'),
  title?: string(name='Title'),
  type?: string(name='Type'),
  versionId?: long(name='VersionId'),
}

model CreateBlockResponseBody = {
  code?: int32(name='Code'),
  data?: long(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateBlockResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBlockResponseBody(name='body'),
}

/**
 * @summary 三方创建封网接口
 *
 * @param request CreateBlockRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBlockResponse
 */
async function createBlockWithOptions(request: CreateBlockRequest, runtime: Util.RuntimeOptions): CreateBlockResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.approveStrategyNodes)) {
    bodyFlat['ApproveStrategyNodes'] = request.approveStrategyNodes;
  }
  if (!Util.isUnset(request.blockId)) {
    body['BlockId'] = request.blockId;
  }
  if (!Util.isUnset(request.director)) {
    body['Director'] = request.director;
  }
  if (!Util.isUnset(request.isNeedApprove)) {
    body['IsNeedApprove'] = request.isNeedApprove;
  }
  if (!Util.isUnset(request.isRecall)) {
    body['IsRecall'] = request.isRecall;
  }
  if (!Util.isUnset(request.isTemplate)) {
    body['IsTemplate'] = request.isTemplate;
  }
  if (!Util.isUnset(request.labelName)) {
    body['LabelName'] = request.labelName;
  }
  if (!Util.isUnset(request.noticeDesc)) {
    body['NoticeDesc'] = request.noticeDesc;
  }
  if (!Util.isUnset(request.noticeEnclosureInfos)) {
    bodyFlat['NoticeEnclosureInfos'] = request.noticeEnclosureInfos;
  }
  if (!Util.isUnset(request.noticeRequestLink)) {
    body['NoticeRequestLink'] = request.noticeRequestLink;
  }
  if (!Util.isUnset(request.noticeType)) {
    body['NoticeType'] = request.noticeType;
  }
  if (!Util.isUnset(request.reason)) {
    body['Reason'] = request.reason;
  }
  if (!Util.isUnset(request.scene)) {
    body['Scene'] = request.scene;
  }
  if (!Util.isUnset(request.scopes)) {
    bodyFlat['Scopes'] = request.scopes;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.versionId)) {
    body['VersionId'] = request.versionId;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateBlock',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 三方创建封网接口
 *
 * @param request CreateBlockRequest
 * @return CreateBlockResponse
 */
async function createBlock(request: CreateBlockRequest): CreateBlockResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBlockWithOptions(request, runtime);
}

model CreateOperatorRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  bgObject?: string(name='BgObject'),
  bgSystem?: string(name='BgSystem'),
  code?: string(name='Code'),
  curEmpId?: string(name='CurEmpId'),
  name?: string(name='Name'),
  noCheck?: boolean(name='NoCheck'),
  noRisk?: boolean(name='NoRisk'),
  reqTimestamp?: long(name='ReqTimestamp'),
}

model CreateOperatorResponseBody = {
  code?: int32(name='Code'),
  data?: {
    approveStrategyId?: long(name='ApproveStrategyId'),
    ruleId?: long(name='RuleId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateOperatorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOperatorResponseBody(name='body'),
}

/**
 * @summary 创建操作类型
 *
 * @param request CreateOperatorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateOperatorResponse
 */
async function createOperatorWithOptions(request: CreateOperatorRequest, runtime: Util.RuntimeOptions): CreateOperatorResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.bgObject)) {
    body['BgObject'] = request.bgObject;
  }
  if (!Util.isUnset(request.bgSystem)) {
    body['BgSystem'] = request.bgSystem;
  }
  if (!Util.isUnset(request.code)) {
    body['Code'] = request.code;
  }
  if (!Util.isUnset(request.curEmpId)) {
    body['CurEmpId'] = request.curEmpId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.noCheck)) {
    body['NoCheck'] = request.noCheck;
  }
  if (!Util.isUnset(request.noRisk)) {
    body['NoRisk'] = request.noRisk;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateOperator',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建操作类型
 *
 * @param request CreateOperatorRequest
 * @return CreateOperatorResponse
 */
async function createOperator(request: CreateOperatorRequest): CreateOperatorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOperatorWithOptions(request, runtime);
}

model QueryRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  needValidate?: boolean(name='NeedValidate'),
  queryType?: string(name='QueryType'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
}

model QueryResponseBody = {
  code?: int32(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryResponseBody(name='body'),
}

/**
 * @summary 变更状态查询
 *
 * @param request QueryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryResponse
 */
async function queryWithOptions(request: QueryRequest, runtime: Util.RuntimeOptions): QueryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authKey)) {
    query['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    query['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.needValidate)) {
    query['NeedValidate'] = request.needValidate;
  }
  if (!Util.isUnset(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    query['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    query['SourceOrderId'] = request.sourceOrderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Query',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更状态查询
 *
 * @param request QueryRequest
 * @return QueryResponse
 */
async function query(request: QueryRequest): QueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryWithOptions(request, runtime);
}

model QueryApproveFlowRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
  stage?: string(name='Stage'),
}

model QueryApproveFlowResponseBody = {
  code?: int32(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryApproveFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryApproveFlowResponseBody(name='body'),
}

/**
 * @summary 查询审批实例信息
 *
 * @param request QueryApproveFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryApproveFlowResponse
 */
async function queryApproveFlowWithOptions(request: QueryApproveFlowRequest, runtime: Util.RuntimeOptions): QueryApproveFlowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authKey)) {
    query['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    query['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    query['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    query['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.stage)) {
    query['Stage'] = request.stage;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryApproveFlow',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询审批实例信息
 *
 * @param request QueryApproveFlowRequest
 * @return QueryApproveFlowResponse
 */
async function queryApproveFlow(request: QueryApproveFlowRequest): QueryApproveFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryApproveFlowWithOptions(request, runtime);
}

model QueryBlockEventRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  bgSystemName?: string(name='BgSystemName'),
  blockHarm?: string(name='BlockHarm'),
  category?: string(name='Category'),
  deptNo?: string(name='DeptNo'),
  endTime?: long(name='EndTime'),
  limit?: int32(name='Limit'),
  needRule?: boolean(name='NeedRule'),
  page?: int32(name='Page'),
  productCodes?: [ string ](name='ProductCodes'),
  regionReqs?: [ 
    {
      productCode?: string(name='ProductCode'),
      regions?: [ string ](name='Regions'),
    }
  ](name='RegionReqs'),
  reqTimestamp?: long(name='ReqTimestamp'),
  scope?: [ string ](name='Scope'),
  startTime?: long(name='StartTime'),
}

model QueryBlockEventResponseBody = {
  code?: int32(name='Code'),
  data?: {
    dataInfo?: [ 
      {
        empId?: string(name='EmpId'),
        endTime?: long(name='EndTime'),
        eventTimes?: [ 
          {
            endTime?: long(name='EndTime'),
            express?: string(name='Express'),
            rule?: [ 
              {
                level1?: string(name='Level1'),
                level2?: string(name='Level2'),
                level3?: string(name='Level3'),
                level4?: string(name='Level4'),
                level5?: string(name='Level5'),
                type?: string(name='Type'),
              }
            ](name='Rule'),
            startTime?: long(name='StartTime'),
          }
        ](name='EventTimes'),
        gmtCreate?: long(name='GmtCreate'),
        gmtModified?: long(name='GmtModified'),
        id?: long(name='Id'),
        reason?: string(name='Reason'),
        startTime?: long(name='StartTime'),
        title?: string(name='Title'),
        url?: string(name='Url'),
      }
    ](name='DataInfo'),
    extraInfo?: map[string]string(name='ExtraInfo'),
    pagination?: {
      limit?: int32(name='Limit'),
      page?: int32(name='Page'),
    }(name='Pagination'),
    total?: long(name='Total'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryBlockEventResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryBlockEventResponseBody(name='body'),
}

/**
 * @summary 查封网事件
 *
 * @param request QueryBlockEventRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryBlockEventResponse
 */
async function queryBlockEventWithOptions(request: QueryBlockEventRequest, runtime: Util.RuntimeOptions): QueryBlockEventResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.scope)) {
    query['Scope'] = request.scope;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.bgSystemName)) {
    body['BgSystemName'] = request.bgSystemName;
  }
  if (!Util.isUnset(request.blockHarm)) {
    body['BlockHarm'] = request.blockHarm;
  }
  if (!Util.isUnset(request.category)) {
    body['Category'] = request.category;
  }
  if (!Util.isUnset(request.deptNo)) {
    body['DeptNo'] = request.deptNo;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    body['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.needRule)) {
    body['NeedRule'] = request.needRule;
  }
  if (!Util.isUnset(request.page)) {
    body['Page'] = request.page;
  }
  if (!Util.isUnset(request.productCodes)) {
    body['ProductCodes'] = request.productCodes;
  }
  if (!Util.isUnset(request.regionReqs)) {
    body['RegionReqs'] = request.regionReqs;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryBlockEvent',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查封网事件
 *
 * @param request QueryBlockEventRequest
 * @return QueryBlockEventResponse
 */
async function queryBlockEvent(request: QueryBlockEventRequest): QueryBlockEventResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBlockEventWithOptions(request, runtime);
}

model QueryChangeInfoRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  az?: [ string ](name='Az'),
  bgVid?: string(name='BgVid'),
  buId?: string(name='BuId'),
  changeSystem?: string(name='ChangeSystem'),
  endTime?: long(name='EndTime'),
  keyword?: string(name='Keyword'),
  levelTree?: {
    dataType?: string(name='DataType'),
    treeData?: [ 
      {
        data?: [ any ](name='Data'),
        dataSubType?: string(name='DataSubType'),
        value?: [ string ](name='Value'),
      }
    ](name='TreeData'),
  }(name='LevelTree'),
  limit?: int32(name='Limit'),
  page?: int32(name='Page'),
  product?: [ string ](name='Product'),
  region?: [ string ](name='Region'),
  reqTimestamp?: long(name='ReqTimestamp'),
  source?: string(name='Source'),
  sourceOrderId?: string(name='SourceOrderId'),
  startTime?: long(name='StartTime'),
  type?: string(name='Type'),
}

model QueryChangeInfoResponseBody = {
  code?: int32(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryChangeInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryChangeInfoResponseBody(name='body'),
}

/**
 * @summary 变更单详情
 *
 * @param request QueryChangeInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryChangeInfoResponse
 */
async function queryChangeInfoWithOptions(request: QueryChangeInfoRequest, runtime: Util.RuntimeOptions): QueryChangeInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.az)) {
    body['Az'] = request.az;
  }
  if (!Util.isUnset(request.bgVid)) {
    body['BgVid'] = request.bgVid;
  }
  if (!Util.isUnset(request.buId)) {
    body['BuId'] = request.buId;
  }
  if (!Util.isUnset(request.changeSystem)) {
    body['ChangeSystem'] = request.changeSystem;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.levelTree)) {
    bodyFlat['LevelTree'] = request.levelTree;
  }
  if (!Util.isUnset(request.limit)) {
    body['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.page)) {
    body['Page'] = request.page;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  if (!Util.isUnset(request.region)) {
    body['Region'] = request.region;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.source)) {
    body['Source'] = request.source;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryChangeInfo',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更单详情
 *
 * @param request QueryChangeInfoRequest
 * @return QueryChangeInfoResponse
 */
async function queryChangeInfo(request: QueryChangeInfoRequest): QueryChangeInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryChangeInfoWithOptions(request, runtime);
}

model QueryCheckInfoRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
}

model QueryCheckInfoResponseBody = {
  code?: int32(name='Code'),
  data?: {
    checkDetailList?: [ 
      {
        blockRule?: [ 
          {
            blockHarm?: string(name='BlockHarm'),
            blockId?: long(name='BlockId'),
            express?: string(name='Express'),
            scopeEndTime?: long(name='ScopeEndTime'),
            scopeNodeList?: [ 
              {
                leafLevel?: string(name='LeafLevel'),
                level1?: string(name='Level1'),
                level2?: string(name='Level2'),
                level3?: string(name='Level3'),
                level4?: string(name='Level4'),
                level5?: string(name='Level5'),
                path?: string(name='Path'),
                ruleId?: long(name='RuleId'),
                type?: string(name='Type'),
              }
            ](name='ScopeNodeList'),
            scopeRuleId?: long(name='ScopeRuleId'),
            scopeStartTime?: long(name='ScopeStartTime'),
          }
        ](name='BlockRule'),
        checkholdReason?: string(name='CheckholdReason'),
        desc?: string(name='Desc'),
        picInfo?: string(name='PicInfo'),
        riskExplain?: string(name='RiskExplain'),
        title?: string(name='Title'),
        url?: string(name='Url'),
      }
    ](name='CheckDetailList'),
    checkResultUrl?: string(name='CheckResultUrl'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryCheckInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCheckInfoResponseBody(name='body'),
}

/**
 * @summary 查询检测详情接口
 *
 * @param request QueryCheckInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryCheckInfoResponse
 */
async function queryCheckInfoWithOptions(request: QueryCheckInfoRequest, runtime: Util.RuntimeOptions): QueryCheckInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryCheckInfo',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询检测详情接口
 *
 * @param request QueryCheckInfoRequest
 * @return QueryCheckInfoResponse
 */
async function queryCheckInfo(request: QueryCheckInfoRequest): QueryCheckInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCheckInfoWithOptions(request, runtime);
}

model QueryCustomerRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  product?: [ string ](name='Product'),
  reqTimestamp?: long(name='ReqTimestamp'),
  type?: string(name='Type'),
}

model QueryCustomerResponseBody = {
  code?: int32(name='Code'),
  data?: [ 
    {
      product?: string(name='Product'),
      type?: string(name='Type'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryCustomerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryCustomerResponseBody(name='body'),
}

/**
 * @summary 查询敏感客户
 *
 * @param request QueryCustomerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryCustomerResponse
 */
async function queryCustomerWithOptions(request: QueryCustomerRequest, runtime: Util.RuntimeOptions): QueryCustomerResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryCustomer',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询敏感客户
 *
 * @param request QueryCustomerRequest
 * @return QueryCustomerResponse
 */
async function queryCustomer(request: QueryCustomerRequest): QueryCustomerResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCustomerWithOptions(request, runtime);
}

model QueryExecuteInfoRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  az?: [ string ](name='Az'),
  bgVid?: string(name='BgVid'),
  buId?: string(name='BuId'),
  endTime?: long(name='EndTime'),
  exVid?: string(name='ExVid'),
  keyword?: string(name='Keyword'),
  levelTree?: {
    dataType?: string(name='DataType'),
    treeData?: [ 
      {
        data?: [ any ](name='Data'),
        dataSubType?: string(name='DataSubType'),
        value?: [ string ](name='Value'),
      }
    ](name='TreeData'),
  }(name='LevelTree'),
  limit?: int32(name='Limit'),
  page?: int32(name='Page'),
  product?: [ string ](name='Product'),
  region?: [ string ](name='Region'),
  reqTimestamp?: long(name='ReqTimestamp'),
  source?: string(name='Source'),
  sourceOrderId?: string(name='SourceOrderId'),
  startTime?: long(name='StartTime'),
}

model QueryExecuteInfoResponseBody = {
  code?: int32(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryExecuteInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryExecuteInfoResponseBody(name='body'),
}

/**
 * @summary 执行单详情
 *
 * @param request QueryExecuteInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryExecuteInfoResponse
 */
async function queryExecuteInfoWithOptions(request: QueryExecuteInfoRequest, runtime: Util.RuntimeOptions): QueryExecuteInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.az)) {
    body['Az'] = request.az;
  }
  if (!Util.isUnset(request.bgVid)) {
    body['BgVid'] = request.bgVid;
  }
  if (!Util.isUnset(request.buId)) {
    body['BuId'] = request.buId;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.exVid)) {
    body['ExVid'] = request.exVid;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.levelTree)) {
    bodyFlat['LevelTree'] = request.levelTree;
  }
  if (!Util.isUnset(request.limit)) {
    body['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.page)) {
    body['Page'] = request.page;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  if (!Util.isUnset(request.region)) {
    body['Region'] = request.region;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.source)) {
    body['Source'] = request.source;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryExecuteInfo',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 执行单详情
 *
 * @param request QueryExecuteInfoRequest
 * @return QueryExecuteInfoResponse
 */
async function queryExecuteInfo(request: QueryExecuteInfoRequest): QueryExecuteInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryExecuteInfoWithOptions(request, runtime);
}

model QueryInnerProductInfoRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  limit?: int32(name='Limit'),
  page?: int32(name='Page'),
  productCode?: string(name='ProductCode'),
  reqTimestamp?: long(name='ReqTimestamp'),
}

model QueryInnerProductInfoResponseBody = {
  code?: int32(name='Code'),
  data?: {
    dataInfo?: [ 
      {
        innerProductCode?: string(name='InnerProductCode'),
        innerProductName?: string(name='InnerProductName'),
        productCode?: string(name='ProductCode'),
        productName?: string(name='ProductName'),
      }
    ](name='DataInfo'),
    pagination?: {
      limit?: int32(name='Limit'),
      page?: int32(name='Page'),
    }(name='Pagination'),
    total?: long(name='Total'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryInnerProductInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryInnerProductInfoResponseBody(name='body'),
}

/**
 * @summary 查询内部产品接口
 *
 * @param request QueryInnerProductInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryInnerProductInfoResponse
 */
async function queryInnerProductInfoWithOptions(request: QueryInnerProductInfoRequest, runtime: Util.RuntimeOptions): QueryInnerProductInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.limit)) {
    body['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.page)) {
    body['Page'] = request.page;
  }
  if (!Util.isUnset(request.productCode)) {
    body['ProductCode'] = request.productCode;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryInnerProductInfo',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询内部产品接口
 *
 * @param request QueryInnerProductInfoRequest
 * @return QueryInnerProductInfoResponse
 */
async function queryInnerProductInfo(request: QueryInnerProductInfoRequest): QueryInnerProductInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryInnerProductInfoWithOptions(request, runtime);
}

model QueryRegionAzRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  limit?: int32(name='Limit'),
  page?: int32(name='Page'),
  product?: string(name='Product'),
  reqTimestamp?: long(name='ReqTimestamp'),
}

model QueryRegionAzResponseBody = {
  code?: int32(name='Code'),
  data?: {
    dataInfo?: [ 
      {
        azList?: [ string ](name='AzList'),
        regionCode?: string(name='RegionCode'),
        regionName?: string(name='RegionName'),
      }
    ](name='DataInfo'),
    pagination?: {
      limit?: int32(name='Limit'),
      page?: int32(name='Page'),
    }(name='Pagination'),
    total?: long(name='Total'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryRegionAzResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRegionAzResponseBody(name='body'),
}

/**
 * @param request QueryRegionAzRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRegionAzResponse
 */
async function queryRegionAzWithOptions(request: QueryRegionAzRequest, runtime: Util.RuntimeOptions): QueryRegionAzResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.limit)) {
    body['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.page)) {
    body['Page'] = request.page;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryRegionAz',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryRegionAzRequest
 * @return QueryRegionAzResponse
 */
async function queryRegionAz(request: QueryRegionAzRequest): QueryRegionAzResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRegionAzWithOptions(request, runtime);
}

model SafeChangeCancelRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  operateEmpNo?: string(name='OperateEmpNo'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
}

model SafeChangeCancelResponseBody = {
  code?: int32(name='Code'),
  data?: {
    sourceOrderId?: string(name='SourceOrderId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SafeChangeCancelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SafeChangeCancelResponseBody(name='body'),
}

/**
 * @summary 变更取消接口
 *
 * @param request SafeChangeCancelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SafeChangeCancelResponse
 */
async function safeChangeCancelWithOptions(request: SafeChangeCancelRequest, runtime: Util.RuntimeOptions): SafeChangeCancelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.operateEmpNo)) {
    body['OperateEmpNo'] = request.operateEmpNo;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SafeChangeCancel',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更取消接口
 *
 * @param request SafeChangeCancelRequest
 * @return SafeChangeCancelResponse
 */
async function safeChangeCancel(request: SafeChangeCancelRequest): SafeChangeCancelResponse {
  var runtime = new Util.RuntimeOptions{};
  return safeChangeCancelWithOptions(request, runtime);
}

model SafeChangeCheckRequest {
  affectCustomer?: string(name='AffectCustomer'),
  approveFlowParam?: {
    approveNodes?: [ 
      {
        approverDTO?: [ 
          {
            approveDesc?: string(name='ApproveDesc'),
            approveTime?: long(name='ApproveTime'),
            approverId?: string(name='ApproverId'),
            approverName?: string(name='ApproverName'),
            opinion?: int32(name='Opinion'),
          }
        ](name='ApproverDTO'),
        nodeStatus?: int32(name='NodeStatus'),
        processName?: string(name='ProcessName'),
        processNodeOrder?: int32(name='ProcessNodeOrder'),
        strategy?: int32(name='Strategy'),
      }
    ](name='ApproveNodes'),
    flowStatus?: int32(name='FlowStatus'),
  }(name='ApproveFlowParam'),
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  bgCustomTemplateExtraDTO?: {
    bgCustomTemplateInfo?: string(name='BgCustomTemplateInfo'),
  }(name='BgCustomTemplateExtraDTO'),
  blockInfos?: [ 
    {
      hitInfos?: [ 
        {
          hitInfo?: string(name='HitInfo'),
          hitObject?: string(name='HitObject'),
          scope?: string(name='Scope'),
        }
      ](name='HitInfos'),
      id?: long(name='Id'),
    }
  ](name='BlockInfos'),
  callBackInfo?: {
    api?: string(name='Api'),
    apiVersion?: string(name='ApiVersion'),
    endPoint?: string(name='EndPoint'),
    popProduct?: string(name='PopProduct'),
    regionId?: string(name='RegionId'),
    type?: string(name='Type'),
    url?: string(name='Url'),
  }(name='CallBackInfo'),
  changeDataType?: string(name='ChangeDataType'),
  changeDesc?: string(name='ChangeDesc'),
  changeEndTime?: long(name='ChangeEndTime'),
  changeEnv?: string(name='ChangeEnv'),
  changeItems?: string(name='ChangeItems'),
  changeObject?: string(name='ChangeObject'),
  changeOptSubType?: string(name='ChangeOptSubType'),
  changeOptType?: string(name='ChangeOptType'),
  changeReason?: string(name='ChangeReason'),
  changeRmarks?: string(name='ChangeRmarks'),
  changeSchemes?: string(name='ChangeSchemes'),
  changeStartTime?: long(name='ChangeStartTime'),
  changeSubTypeDesc?: string(name='ChangeSubTypeDesc'),
  changeSystem?: string(name='ChangeSystem'),
  changeTimes?: [ 
    {
      changeEndTime?: long(name='ChangeEndTime'),
      changeStartTime?: long(name='ChangeStartTime'),
    }
  ](name='ChangeTimes'),
  changeTitle?: string(name='ChangeTitle'),
  changeValidation?: string(name='ChangeValidation'),
  checker?: [ string ](name='Checker'),
  creatorEmpId?: string(name='CreatorEmpId'),
  damagedChangeNotices?: [ 
    {
      bgCancelNoticeContent?: string(name='BgCancelNoticeContent'),
      bgCancelNoticeEventId?: string(name='BgCancelNoticeEventId'),
      channel?: [ string ](name='Channel'),
      content?: string(name='Content'),
      eventId?: string(name='EventId'),
      sensitiveCustomers?: [ 
        {
          customerInfo?: [ 
            {
              extraInfo?: map[string]any(name='ExtraInfo'),
              type?: string(name='Type'),
              uid?: string(name='Uid'),
            }
          ](name='CustomerInfo'),
          productCode?: string(name='ProductCode'),
        }
      ](name='SensitiveCustomers'),
      type?: string(name='Type'),
    }
  ](name='DamagedChangeNotices'),
  executorEmpId?: string(name='ExecutorEmpId'),
  extraInfo?: string(name='ExtraInfo'),
  follower?: [ string ](name='Follower'),
  grayStatus?: string(name='GrayStatus'),
  harmChangeNoticeEnum?: string(name='HarmChangeNoticeEnum'),
  incidence?: string(name='Incidence'),
  influenceInfo?: {
    noticeInfos?: [ 
      {
        channel?: [ string ](name='Channel'),
        content?: string(name='Content'),
        eventId?: string(name='EventId'),
      }
    ](name='NoticeInfos'),
    sensitiveCustomers?: [ 
      {
        customerInfo?: [ 
          {
            extraInfo?: map[string]any(name='ExtraInfo'),
            type?: string(name='Type'),
            uid?: string(name='Uid'),
          }
        ](name='CustomerInfo'),
        productCode?: string(name='ProductCode'),
      }
    ](name='SensitiveCustomers'),
  }(name='InfluenceInfo'),
  instance?: {
    nc?: [ string ](name='Nc'),
    uids?: [ string ](name='Uids'),
    attributionApp?: [ string ](name='attributionApp'),
    influenceApp?: [ string ](name='influenceApp'),
    instance?: [ string ](name='instance'),
  }(name='Instance'),
  needModifyDoc?: string(name='NeedModifyDoc'),
  operateEmpNo?: string(name='OperateEmpNo'),
  product?: [ 
    {
      code?: string(name='Code'),
      name?: string(name='Name'),
    }
  ](name='Product'),
  releasePackageInfos?: [ 
    {
      productCode?: string(name='ProductCode'),
      releasePackage?: [ string ](name='ReleasePackage'),
    }
  ](name='ReleasePackageInfos'),
  reqTimestamp?: long(name='ReqTimestamp'),
  reuseSourceOrderId?: string(name='ReuseSourceOrderId'),
  riskLevel?: string(name='RiskLevel'),
  rollback?: string(name='Rollback'),
  sourceName?: string(name='SourceName'),
  sourceOrderId?: string(name='SourceOrderId'),
  sourceUrl?: string(name='SourceUrl'),
  whiteType?: int32(name='whiteType'),
}

model SafeChangeCheckResponseBody = {
  code?: int32(name='Code'),
  data?: {
    approveResultUrl?: string(name='ApproveResultUrl'),
    bgCheckStatus?: string(name='BgCheckStatus'),
    bgVid?: string(name='BgVid'),
    checkResultUrl?: string(name='CheckResultUrl'),
    checkStatus?: string(name='CheckStatus'),
    checkholdReason?: [ string ](name='CheckholdReason'),
    ruleDetailUrlList?: [ 
      {
        sceneEnum?: string(name='SceneEnum'),
        title?: string(name='Title'),
        url?: string(name='Url'),
      }
    ](name='RuleDetailUrlList'),
    sourceOrderId?: string(name='SourceOrderId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SafeChangeCheckResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SafeChangeCheckResponseBody(name='body'),
}

/**
 * @summary 变更check接口
 *
 * @param request SafeChangeCheckRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SafeChangeCheckResponse
 */
async function safeChangeCheckWithOptions(request: SafeChangeCheckRequest, runtime: Util.RuntimeOptions): SafeChangeCheckResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.checker)) {
    query['Checker'] = request.checker;
  }
  if (!Util.isUnset(request.harmChangeNoticeEnum)) {
    query['HarmChangeNoticeEnum'] = request.harmChangeNoticeEnum;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.affectCustomer)) {
    body['AffectCustomer'] = request.affectCustomer;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.approveFlowParam)) {
    bodyFlat['ApproveFlowParam'] = request.approveFlowParam;
  }
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.bgCustomTemplateExtraDTO)) {
    bodyFlat['BgCustomTemplateExtraDTO'] = request.bgCustomTemplateExtraDTO;
  }
  if (!Util.isUnset(request.blockInfos)) {
    body['BlockInfos'] = request.blockInfos;
  }
  if (!Util.isUnset(request.callBackInfo)) {
    bodyFlat['CallBackInfo'] = request.callBackInfo;
  }
  if (!Util.isUnset(request.changeDataType)) {
    body['ChangeDataType'] = request.changeDataType;
  }
  if (!Util.isUnset(request.changeDesc)) {
    body['ChangeDesc'] = request.changeDesc;
  }
  if (!Util.isUnset(request.changeEndTime)) {
    body['ChangeEndTime'] = request.changeEndTime;
  }
  if (!Util.isUnset(request.changeEnv)) {
    body['ChangeEnv'] = request.changeEnv;
  }
  if (!Util.isUnset(request.changeItems)) {
    body['ChangeItems'] = request.changeItems;
  }
  if (!Util.isUnset(request.changeObject)) {
    body['ChangeObject'] = request.changeObject;
  }
  if (!Util.isUnset(request.changeOptSubType)) {
    body['ChangeOptSubType'] = request.changeOptSubType;
  }
  if (!Util.isUnset(request.changeOptType)) {
    body['ChangeOptType'] = request.changeOptType;
  }
  if (!Util.isUnset(request.changeReason)) {
    body['ChangeReason'] = request.changeReason;
  }
  if (!Util.isUnset(request.changeRmarks)) {
    body['ChangeRmarks'] = request.changeRmarks;
  }
  if (!Util.isUnset(request.changeSchemes)) {
    body['ChangeSchemes'] = request.changeSchemes;
  }
  if (!Util.isUnset(request.changeStartTime)) {
    body['ChangeStartTime'] = request.changeStartTime;
  }
  if (!Util.isUnset(request.changeSubTypeDesc)) {
    body['ChangeSubTypeDesc'] = request.changeSubTypeDesc;
  }
  if (!Util.isUnset(request.changeSystem)) {
    body['ChangeSystem'] = request.changeSystem;
  }
  if (!Util.isUnset(request.changeTimes)) {
    body['ChangeTimes'] = request.changeTimes;
  }
  if (!Util.isUnset(request.changeTitle)) {
    body['ChangeTitle'] = request.changeTitle;
  }
  if (!Util.isUnset(request.changeValidation)) {
    body['ChangeValidation'] = request.changeValidation;
  }
  if (!Util.isUnset(request.creatorEmpId)) {
    body['CreatorEmpId'] = request.creatorEmpId;
  }
  if (!Util.isUnset(request.damagedChangeNotices)) {
    bodyFlat['DamagedChangeNotices'] = request.damagedChangeNotices;
  }
  if (!Util.isUnset(request.executorEmpId)) {
    body['ExecutorEmpId'] = request.executorEmpId;
  }
  if (!Util.isUnset(request.extraInfo)) {
    body['ExtraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.follower)) {
    body['Follower'] = request.follower;
  }
  if (!Util.isUnset(request.grayStatus)) {
    body['GrayStatus'] = request.grayStatus;
  }
  if (!Util.isUnset(request.incidence)) {
    body['Incidence'] = request.incidence;
  }
  if (!Util.isUnset(request.influenceInfo)) {
    bodyFlat['InfluenceInfo'] = request.influenceInfo;
  }
  if (!Util.isUnset(request.instance)) {
    bodyFlat['Instance'] = request.instance;
  }
  if (!Util.isUnset(request.needModifyDoc)) {
    body['NeedModifyDoc'] = request.needModifyDoc;
  }
  if (!Util.isUnset(request.operateEmpNo)) {
    body['OperateEmpNo'] = request.operateEmpNo;
  }
  if (!Util.isUnset(request.product)) {
    body['Product'] = request.product;
  }
  if (!Util.isUnset(request.releasePackageInfos)) {
    body['ReleasePackageInfos'] = request.releasePackageInfos;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.reuseSourceOrderId)) {
    body['ReuseSourceOrderId'] = request.reuseSourceOrderId;
  }
  if (!Util.isUnset(request.riskLevel)) {
    body['RiskLevel'] = request.riskLevel;
  }
  if (!Util.isUnset(request.rollback)) {
    body['Rollback'] = request.rollback;
  }
  if (!Util.isUnset(request.sourceName)) {
    body['SourceName'] = request.sourceName;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.sourceUrl)) {
    body['SourceUrl'] = request.sourceUrl;
  }
  if (!Util.isUnset(request.whiteType)) {
    body['whiteType'] = request.whiteType;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SafeChangeCheck',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更check接口
 *
 * @param request SafeChangeCheckRequest
 * @return SafeChangeCheckResponse
 */
async function safeChangeCheck(request: SafeChangeCheckRequest): SafeChangeCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return safeChangeCheckWithOptions(request, runtime);
}

model SafeChangeEndRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  changeEndTime?: long(name='ChangeEndTime'),
  changeResult?: string(name='ChangeResult'),
  curBatchNo?: int32(name='CurBatchNo'),
  executorEmpId?: string(name='ExecutorEmpId'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
  totalBatchNo?: int32(name='TotalBatchNo'),
}

model SafeChangeEndResponseBody = {
  code?: int32(name='Code'),
  data?: {
    status?: string(name='Status'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SafeChangeEndResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SafeChangeEndResponseBody(name='body'),
}

/**
 * @summary 变更End接口
 *
 * @param request SafeChangeEndRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SafeChangeEndResponse
 */
async function safeChangeEndWithOptions(request: SafeChangeEndRequest, runtime: Util.RuntimeOptions): SafeChangeEndResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.changeEndTime)) {
    body['ChangeEndTime'] = request.changeEndTime;
  }
  if (!Util.isUnset(request.changeResult)) {
    body['ChangeResult'] = request.changeResult;
  }
  if (!Util.isUnset(request.curBatchNo)) {
    body['CurBatchNo'] = request.curBatchNo;
  }
  if (!Util.isUnset(request.executorEmpId)) {
    body['ExecutorEmpId'] = request.executorEmpId;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.totalBatchNo)) {
    body['TotalBatchNo'] = request.totalBatchNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SafeChangeEnd',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更End接口
 *
 * @param request SafeChangeEndRequest
 * @return SafeChangeEndResponse
 */
async function safeChangeEnd(request: SafeChangeEndRequest): SafeChangeEndResponse {
  var runtime = new Util.RuntimeOptions{};
  return safeChangeEndWithOptions(request, runtime);
}

model SafeChangeQueryRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  needValidate?: boolean(name='NeedValidate'),
  queryType?: string(name='QueryType'),
  reqTimestamp?: long(name='ReqTimestamp'),
  returnType?: boolean(name='ReturnType'),
  sourceOrderId?: string(name='SourceOrderId'),
}

model SafeChangeQueryResponseBody = {
  code?: int32(name='Code'),
  data?: {
    approveResultUrl?: string(name='ApproveResultUrl'),
    approveStatus?: string(name='ApproveStatus'),
    changeCancel?: string(name='ChangeCancel'),
    changeEndTime?: long(name='ChangeEndTime'),
    changeObject?: string(name='ChangeObject'),
    changeOptType?: string(name='ChangeOptType'),
    changeResult?: string(name='ChangeResult'),
    changeStartTime?: long(name='ChangeStartTime'),
    changeStatus?: string(name='ChangeStatus'),
    changeSystem?: string(name='ChangeSystem'),
    changeTimes?: [ 
      {
        changeEndTime?: long(name='ChangeEndTime'),
        changeStartTime?: long(name='ChangeStartTime'),
      }
    ](name='ChangeTimes'),
    changeTitle?: string(name='ChangeTitle'),
    checkResultUrl?: string(name='CheckResultUrl'),
    checkStatus?: string(name='CheckStatus'),
    checkholdReason?: [ string ](name='CheckholdReason'),
    executorEmpId?: string(name='ExecutorEmpId'),
    executorEmpName?: string(name='ExecutorEmpName'),
    sourceOrderId?: string(name='SourceOrderId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SafeChangeQueryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SafeChangeQueryResponseBody(name='body'),
}

/**
 * @summary 变更单查询
 *
 * @param request SafeChangeQueryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SafeChangeQueryResponse
 */
async function safeChangeQueryWithOptions(request: SafeChangeQueryRequest, runtime: Util.RuntimeOptions): SafeChangeQueryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.returnType)) {
    query['ReturnType'] = request.returnType;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.needValidate)) {
    body['NeedValidate'] = request.needValidate;
  }
  if (!Util.isUnset(request.queryType)) {
    body['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SafeChangeQuery',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更单查询
 *
 * @param request SafeChangeQueryRequest
 * @return SafeChangeQueryResponse
 */
async function safeChangeQuery(request: SafeChangeQueryRequest): SafeChangeQueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return safeChangeQueryWithOptions(request, runtime);
}

model SafeChangeQueryApproveFlowRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
  stage?: string(name='Stage'),
}

model SafeChangeQueryApproveFlowResponseBody = {
  code?: int32(name='Code'),
  data?: [ 
    {
      approveStrategy?: string(name='ApproveStrategy'),
      approver?: string(name='Approver'),
      nodeName?: string(name='NodeName'),
      nodeStatus?: string(name='NodeStatus'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SafeChangeQueryApproveFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SafeChangeQueryApproveFlowResponseBody(name='body'),
}

/**
 * @summary 查询审批实例信息
 *
 * @param request SafeChangeQueryApproveFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SafeChangeQueryApproveFlowResponse
 */
async function safeChangeQueryApproveFlowWithOptions(request: SafeChangeQueryApproveFlowRequest, runtime: Util.RuntimeOptions): SafeChangeQueryApproveFlowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.stage)) {
    body['Stage'] = request.stage;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SafeChangeQueryApproveFlow',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询审批实例信息
 *
 * @param request SafeChangeQueryApproveFlowRequest
 * @return SafeChangeQueryApproveFlowResponse
 */
async function safeChangeQueryApproveFlow(request: SafeChangeQueryApproveFlowRequest): SafeChangeQueryApproveFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return safeChangeQueryApproveFlowWithOptions(request, runtime);
}

model SafeChangeStartRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  changeEndTime?: long(name='ChangeEndTime'),
  changeObject?: string(name='ChangeObject'),
  changeOptType?: string(name='ChangeOptType'),
  changeStartTime?: long(name='ChangeStartTime'),
  changeTitle?: string(name='ChangeTitle'),
  creatorEmpId?: string(name='CreatorEmpId'),
  curBatchNo?: int32(name='CurBatchNo'),
  executorEmpId?: string(name='ExecutorEmpId'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
  totalBatchNo?: int32(name='TotalBatchNo'),
}

model SafeChangeStartResponseBody = {
  code?: int32(name='Code'),
  data?: {
    approveResultUrl?: string(name='ApproveResultUrl'),
    checkResultUrl?: string(name='CheckResultUrl'),
    status?: string(name='Status'),
    subSatus?: string(name='SubSatus'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SafeChangeStartResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SafeChangeStartResponseBody(name='body'),
}

/**
 * @summary 变更Start接口
 *
 * @param request SafeChangeStartRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SafeChangeStartResponse
 */
async function safeChangeStartWithOptions(request: SafeChangeStartRequest, runtime: Util.RuntimeOptions): SafeChangeStartResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.changeEndTime)) {
    body['ChangeEndTime'] = request.changeEndTime;
  }
  if (!Util.isUnset(request.changeObject)) {
    body['ChangeObject'] = request.changeObject;
  }
  if (!Util.isUnset(request.changeOptType)) {
    body['ChangeOptType'] = request.changeOptType;
  }
  if (!Util.isUnset(request.changeStartTime)) {
    body['ChangeStartTime'] = request.changeStartTime;
  }
  if (!Util.isUnset(request.changeTitle)) {
    body['ChangeTitle'] = request.changeTitle;
  }
  if (!Util.isUnset(request.creatorEmpId)) {
    body['CreatorEmpId'] = request.creatorEmpId;
  }
  if (!Util.isUnset(request.curBatchNo)) {
    body['CurBatchNo'] = request.curBatchNo;
  }
  if (!Util.isUnset(request.executorEmpId)) {
    body['ExecutorEmpId'] = request.executorEmpId;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  if (!Util.isUnset(request.totalBatchNo)) {
    body['TotalBatchNo'] = request.totalBatchNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SafeChangeStart',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 变更Start接口
 *
 * @param request SafeChangeStartRequest
 * @return SafeChangeStartResponse
 */
async function safeChangeStart(request: SafeChangeStartRequest): SafeChangeStartResponse {
  var runtime = new Util.RuntimeOptions{};
  return safeChangeStartWithOptions(request, runtime);
}

model SafeChangeStartApproveRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  creatorEmpId?: string(name='CreatorEmpId'),
  extraInfo?: string(name='ExtraInfo'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
}

model SafeChangeStartApproveResponseBody = {
  code?: int32(name='Code'),
  data?: {
    approveStatus?: string(name='ApproveStatus'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SafeChangeStartApproveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SafeChangeStartApproveResponseBody(name='body'),
}

/**
 * @summary 提交审批
 *
 * @param request SafeChangeStartApproveRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SafeChangeStartApproveResponse
 */
async function safeChangeStartApproveWithOptions(request: SafeChangeStartApproveRequest, runtime: Util.RuntimeOptions): SafeChangeStartApproveResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.creatorEmpId)) {
    body['CreatorEmpId'] = request.creatorEmpId;
  }
  if (!Util.isUnset(request.extraInfo)) {
    body['ExtraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    body['SourceOrderId'] = request.sourceOrderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SafeChangeStartApprove',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交审批
 *
 * @param request SafeChangeStartApproveRequest
 * @return SafeChangeStartApproveResponse
 */
async function safeChangeStartApprove(request: SafeChangeStartApproveRequest): SafeChangeStartApproveResponse {
  var runtime = new Util.RuntimeOptions{};
  return safeChangeStartApproveWithOptions(request, runtime);
}

model SafeScopeDataRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  category?: string(name='Category'),
  codeList?: string(name='CodeList'),
  factor?: string(name='Factor'),
  groupBy?: string(name='GroupBy'),
  idList?: string(name='IdList'),
  item?: string(name='Item'),
  limit?: int32(name='Limit'),
  needTotalCount?: boolean(name='NeedTotalCount'),
  orderBy?: string(name='OrderBy'),
  orderDirection?: string(name='OrderDirection'),
  page?: int32(name='Page'),
  parentCode?: string(name='ParentCode'),
  parentId?: long(name='ParentId'),
  productCode?: string(name='ProductCode'),
  productId?: long(name='ProductId'),
  regionNameEn?: string(name='RegionNameEn'),
  reqTimestamp?: long(name='ReqTimestamp'),
  searchValue?: string(name='SearchValue'),
  type?: int32(name='Type'),
  uid?: string(name='Uid'),
}

model SafeScopeDataResponseBody = {
  code?: int32(name='Code'),
  data?: {
    data?: [ any ](name='Data'),
    extraInfo?: map[string]string(name='ExtraInfo'),
    pagination?: {
      limit?: int32(name='Limit'),
      page?: int32(name='Page'),
    }(name='Pagination'),
    total?: long(name='Total'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SafeScopeDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SafeScopeDataResponseBody(name='body'),
}

/**
 * @summary 封网范围数据查询
 *
 * @param request SafeScopeDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SafeScopeDataResponse
 */
async function safeScopeDataWithOptions(request: SafeScopeDataRequest, runtime: Util.RuntimeOptions): SafeScopeDataResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.category)) {
    body['Category'] = request.category;
  }
  if (!Util.isUnset(request.codeList)) {
    body['CodeList'] = request.codeList;
  }
  if (!Util.isUnset(request.factor)) {
    body['Factor'] = request.factor;
  }
  if (!Util.isUnset(request.groupBy)) {
    body['GroupBy'] = request.groupBy;
  }
  if (!Util.isUnset(request.idList)) {
    body['IdList'] = request.idList;
  }
  if (!Util.isUnset(request.item)) {
    body['Item'] = request.item;
  }
  if (!Util.isUnset(request.limit)) {
    body['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.needTotalCount)) {
    body['NeedTotalCount'] = request.needTotalCount;
  }
  if (!Util.isUnset(request.orderBy)) {
    body['OrderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.orderDirection)) {
    body['OrderDirection'] = request.orderDirection;
  }
  if (!Util.isUnset(request.page)) {
    body['Page'] = request.page;
  }
  if (!Util.isUnset(request.parentCode)) {
    body['ParentCode'] = request.parentCode;
  }
  if (!Util.isUnset(request.parentId)) {
    body['ParentId'] = request.parentId;
  }
  if (!Util.isUnset(request.productCode)) {
    body['ProductCode'] = request.productCode;
  }
  if (!Util.isUnset(request.productId)) {
    body['ProductId'] = request.productId;
  }
  if (!Util.isUnset(request.regionNameEn)) {
    body['RegionNameEn'] = request.regionNameEn;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.searchValue)) {
    body['SearchValue'] = request.searchValue;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.uid)) {
    body['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SafeScopeData',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 封网范围数据查询
 *
 * @param request SafeScopeDataRequest
 * @return SafeScopeDataResponse
 */
async function safeScopeData(request: SafeScopeDataRequest): SafeScopeDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return safeScopeDataWithOptions(request, runtime);
}

model StartApproveRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  creatorEmpId?: string(name='CreatorEmpId'),
  extraInfo?: string(name='ExtraInfo'),
  reqTimestamp?: long(name='ReqTimestamp'),
  sourceOrderId?: string(name='SourceOrderId'),
}

model StartApproveResponseBody = {
  code?: int32(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model StartApproveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartApproveResponseBody(name='body'),
}

/**
 * @summary 提交审批
 *
 * @param request StartApproveRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartApproveResponse
 */
async function startApproveWithOptions(request: StartApproveRequest, runtime: Util.RuntimeOptions): StartApproveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authKey)) {
    query['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    query['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.creatorEmpId)) {
    query['CreatorEmpId'] = request.creatorEmpId;
  }
  if (!Util.isUnset(request.extraInfo)) {
    query['ExtraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    query['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.sourceOrderId)) {
    query['SourceOrderId'] = request.sourceOrderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartApprove',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交审批
 *
 * @param request StartApproveRequest
 * @return StartApproveResponse
 */
async function startApprove(request: StartApproveRequest): StartApproveResponse {
  var runtime = new Util.RuntimeOptions{};
  return startApproveWithOptions(request, runtime);
}

model SyncProductRequest {
  authKey?: string(name='AuthKey'),
  authSign?: string(name='AuthSign'),
  reqTimestamp?: long(name='ReqTimestamp'),
  syncProductList?: [ 
    {
      code?: string(name='Code'),
      innerProductList?: [ 
        {
          code?: string(name='Code'),
          name?: string(name='Name'),
        }
      ](name='InnerProductList'),
      name?: string(name='Name'),
    }
  ](name='SyncProductList'),
}

model SyncProductResponseBody = {
  code?: int32(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SyncProductResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SyncProductResponseBody(name='body'),
}

/**
 * @summary 同步产品接口
 *
 * @param request SyncProductRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SyncProductResponse
 */
async function syncProductWithOptions(request: SyncProductRequest, runtime: Util.RuntimeOptions): SyncProductResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.authKey)) {
    body['AuthKey'] = request.authKey;
  }
  if (!Util.isUnset(request.authSign)) {
    body['AuthSign'] = request.authSign;
  }
  if (!Util.isUnset(request.reqTimestamp)) {
    body['ReqTimestamp'] = request.reqTimestamp;
  }
  if (!Util.isUnset(request.syncProductList)) {
    body['SyncProductList'] = request.syncProductList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SyncProduct',
    version = '2022-01-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 同步产品接口
 *
 * @param request SyncProductRequest
 * @return SyncProductResponse
 */
async function syncProduct(request: SyncProductRequest): SyncProductResponse {
  var runtime = new Util.RuntimeOptions{};
  return syncProductWithOptions(request, runtime);
}

